package cn.iocoder.an.module.business.controller.admin.repairtask.vo;

import cn.iocoder.an.module.business.controller.admin.repairrequest.vo.RepairRequestRespVO;
import cn.iocoder.an.module.business.dal.dataobject.equipmentmanage.EquipmentManageDO;
import cn.iocoder.an.module.business.dal.dataobject.maintenanceclassification.MaintenanceClassificationDO;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fhs.core.trans.anno.Trans;
import com.fhs.core.trans.constant.TransType;
import com.fhs.core.trans.vo.VO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.math.BigDecimal;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import cn.idev.excel.annotation.*;

@Schema(description = "管理后台 - 维修任务 Response VO")
@Data
@ExcelIgnoreUnannotated
public class RepairTaskRespVO implements VO {

    @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "22676")
    @ExcelProperty("id")
    private Long id;

    @Schema(description = "维修申请单", requiredMode = Schema.RequiredMode.REQUIRED, example = "25798")
    @ExcelProperty("维修申请单")
    private Long repairId;

    @Schema(description = "维修分类", requiredMode = Schema.RequiredMode.REQUIRED, example = "21144")
    @ExcelProperty("维修分类")
    @Trans(type = TransType.SIMPLE,target = MaintenanceClassificationDO.class ,fields = "name",ref = "maintenanceName")
    private Long maintenanceId;

    @Schema(description = "维修分类", requiredMode = Schema.RequiredMode.REQUIRED, example = "21144")
    @ExcelProperty("维修分类")
    private String maintenanceName;


    @Schema(description = "设备id", requiredMode = Schema.RequiredMode.REQUIRED, example = "16075")
    @ExcelProperty("设备")
    @Trans(type = TransType.SIMPLE, target = EquipmentManageDO.class,   fields = {"equipmentModel", "deptName","code","equipmentName"},refs = {"equipmentModel", "deptName","code","equipmentName"})
    private Long equipmentId;

    @Schema(description = "设备名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
    @ExcelProperty("设备名称")
    private String equipmentName;

    @Schema(description = "设备编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
    @ExcelProperty("设备编号")
    private String code;

    @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED, example = "信息部")
    @ExcelProperty("所属部门")
    private String deptName;



    @Schema(description = "开始时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("开始时间")
    private LocalDateTime startTime;

    @Schema(description = "结束时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("结束时间")
    private LocalDateTime endTime;

    @Schema(description = "维修时长(分钟)")
    @ExcelProperty("维修时长(分钟)")
    private Integer repairDuration;

    @Schema(description = "维修成本(元)")
    @ExcelProperty("维修成本(元)")
    private BigDecimal repairCost;

    @Schema(description = "是否解决")
    @ExcelProperty("是否解决")
    private Integer resolved;

    @Schema(description = "故障分析", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("故障分析")
    private String faultAnalysis;

    @Schema(description = "维修事项", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("维修事项")
    private String repairItem;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    private RepairRequestRespVO repairRequest;


}